import App from './App'
import Vue from 'vue'
import uView from "uview-ui"
import {
	API
} from "@/utils/api.js"; //接口地址
import "@/utils/router"; //路由拦截
import share from "@/utils/share.js"; //全局分享
Vue.use(uView);
Vue.mixin(share);
Vue.prototype.$API = API;
Vue.prototype.$status = true;
Vue.prototype.$to = (url) => {
	//跳转页面
	if (typeof url == "number") {
		return uni.navigateBack({
			delta: url
		});
	}
	return uni.navigateTo({
		url
	});
}
Vue.prototype.$viewImg = (url, current = 0) => {
	//预览图片 判断传入的是字符串还是数组
	uni.previewImage({
		current,
		urls: Array.isArray(url) ? url : [url],
	})
}
Vue.prototype.$set_title = (title) => {
	uni.setNavigationBarTitle({
		title
	});
}
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
